package com.ss.android.article.base.feature.user.social;

import android.app.ProgressDialog;
import android.content.Context;
import android.view.View;
import com.bytedance.common.utility.UIUtils;
import com.ss.android.article.base.feature.e.j;
import com.ss.android.article.browser.R;
import com.ss.android.common.util.NetworkUtils;
import com.ss.android.model.BaseArticle;
import java.lang.ref.WeakReference;

final class b implements View.OnClickListener {
    private final ReportActivity a;

    b(ReportActivity arg1) {
        this.a = arg1;
    }

    public final void onClick(View arg16) {
        ReportActivity v0 = this.a;
        if(!v0.l && !v0.q) {
            if(!NetworkUtils.isNetworkAvailable(v0.getApplicationContext())) {
                v0.a(0, R.string.net_unvailable);
            }
            else {
                v0.l = true;
                if(v0.a < 0) {
                    UIUtils.showImageToast(((Context)v0), R.drawable.close_popup_textpage, R.string.toast_report_no_type);
                }
                else {
                    String v7 = null;
                    if(v0.a == 0) {
                        v7 = v0.b.getText().toString();
                        if(android.support.design.a.isTextEmpty(v7)) {
                            UIUtils.showImageToast(((Context)v0), R.drawable.close_popup_textpage, R.string.toast_report_no_content);
                            return;
                        }
                    }

                    ProgressDialog v1 = com.ss.android.j.b.createProgressDialog(((Context)v0));
                    v1.setMessage(v0.getString(com.ss.android.article.browser.R.string.info_is_committing_report));
                    v1.setCancelable(false);
                    v1.setCanceledOnTouchOutside(false);
                    v1.show();
                    v0.n = new WeakReference(v1);
                    switch(v0.h) {
                        case 1: {
                            i v3 = new i(v0, v0.m, v0.a, v7, v0.i);
                            v3.a = v0.r;
                            v3.b = v0.s;
                            v3.c = v0.t;
                            v3.start();
                            return;
                        }
                        case 0: 
                        case 2: {
                            new j(v0, v0.m, v0.a, v7, new BaseArticle(v0.d, v0.e, v0.f), v0.g, v0.j, null).start();
                        }
                        case 4: {
                            new j(v0, v0.m, v0.a, v7, new BaseArticle(v0.d, v0.e, v0.f), v0.g, v0.j, v0.k).start();
                            return;
                        }
                    }

                    return;
                }
            }
        }
    }
}

